# Maintainer: 
pkgname=jwhois
pkgver=4.0
pkgrel=4
pkgdesc="WHOIS/RWHOIS client"
url="https://www.gnu.org/software/jwhois/"
license="GPL"
depends=
makedepends="autoconf automake libtool gdbm-dev"
install=
subpackages="$pkgname-doc"
source="https://ftp.gnu.org/gnu/$pkgname/$pkgname-$pkgver.tar.gz
	automake.patch
	jwhois-libiconv.patch
	no-gnulib.patch"
arch="all"

_builddir="$srcdir/$pkgname-$pkgver"

prepare() {
	cd "$_builddir"
	update_config_sub || return 1
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
	autoreconf
}

build() {
	cd "$_builddir"
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/ \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--infodir=/usr/share/info \
		--disable-nls \
		--with-cache \
		|| return 1
	make || return 1
}

package() {
	cd "$_builddir"
	make DESTDIR="$pkgdir" install
}

sha512sums="5d625c3f1031a8eb8ef766ef5d47a8c1a4396d1ad3344fc9449f80dd71ad84aadf21ba67f5c2f99348f732a4df998eefe699fcec4efcadf87f579b70302a44ae  jwhois-4.0.tar.gz
28d191d01569b68e3453e116fb7294405c38be6c3cea7bc4e3bb8039e823e0af3919501a8291512f4c0b8990b57f6711dc347a432cf9833fe9dcf402358def92  automake.patch
0daee64f91c8dfd6faa4ad751889aaf10805d7b127bd62856112bdcdd9cb4b29c2e2e62d58a9843cd4d511648c2264a1d47f42137bca8ed59d5a6a7d803c857d  jwhois-libiconv.patch
60f081d544044ba2ab91f231df0c8facf76b89b406906b61d5b395ca3d299a0d712cd177fe98464db918803500e5f149a4eac44932e47f8cede4ab162bea638e  no-gnulib.patch"
